package org.yiming.tools.mqtt.client.utils;

/**
 * @author renwenpeng
 * date  2022/3/26 11:18 上午
 */
public final class ConsoleUtil {
    private ConsoleUtil() {
    }

    private static volatile boolean isKeySthIn = false;
    private static final String CMD_FLAG = "mqtt-cli > ";

    public static void printStart(){
        if (isKeySthIn) {
            System.out.println();
        }
    }
    public static void printStop(){
        if (isKeySthIn) {
            keySthInStart();
        }
    }
    public static void keySthInStart() {
        System.out.print(CMD_FLAG);
        isKeySthIn = true;
    }
    public static void keySthInStop() {
        isKeySthIn = false;
    }
    public static boolean isIsKeySthIn() {
        return isKeySthIn;
    }
}
